
package com.joysuch.wwyt.bp.enums;

/**
 * 文档状态
 */
public enum RegulationDocumentTypes {

    TO_BE_AUDITED(0, "DOC_TBA", "待申请"),
    AUDIT_WAIT(1, "DOC_AW", "等待审核"),
    AUDIT_FAILED(2, "DOC_AF", "审核不通过"),
    AUDIT_PASS(3, "DOC_AP", "审核通过");

    private int id;
    private String code;
    private String name;

    private RegulationDocumentTypes(int id, String code, String name) {
        this.id = id;
        this.name = name;
        this.code = code;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public RegulationDocumentTypes findByName(String name) {
        RegulationDocumentTypes[] values = RegulationDocumentTypes.values();
        for (RegulationDocumentTypes v : values) {
            if (v.getName().equals(name)) {
                return v;
            }
        }
        return null;
    }

    public static RegulationDocumentTypes findByID(int id) {
        RegulationDocumentTypes[] values = RegulationDocumentTypes.values();
        for (RegulationDocumentTypes v : values) {
            if (v.getId() == id) {
                return v;
            }
        }
        return null;
    }
}
